//
//  EVAlertView.h
//  EVClub
//
//  Created by sam on 14/10/27.
//  Copyright (c) 2014年 BitRice. All rights reserved.
//
#import "TDAlertView.h"
#import "EVDefaultAlertConentView.h"
#import "EVSimpleAlertContentView.h"
#import <Foundation/Foundation.h>

typedef struct {
    NSInteger alertTag;
    NSInteger buttonIndex;
} EVAlertViewStruct;

extern const NSInteger EVAlertViewButtonIndexCancel;
extern const NSInteger EVAlertViewButtonIndexCommit;

@interface EVAlertView : NSObject<TDAlertViewDelegate>

@property (nonatomic,assign) NSInteger    tag;
@property (nonatomic,assign) BOOL outsideClickedDismiss;
@property (nonatomic,strong) TDAlertView *alertView;
@property (nonatomic,strong) UIView *contentView;
@property (nonatomic,assign) BOOL hideDefaultBackground;
@property (nonatomic,copy) UIColor *maskColor;
@property (nonatomic, copy) void(^contentDidAddedBlock)();
/**
 *  仅对EVDefaultAlertContentView生效
 */
@property (nonatomic,assign) BOOL showCloseButton;

- (id)initWithIcon:(EVAlertIcon)alertIcon title:(NSString *)title detail:(NSString *)detail commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton completionBlock:(void (^)())completion dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;

- (id)initWithContentView:(UIView *)contentView CompletionBlock:(void(^)())completion dismissBlock:(void(^)(EVAlertViewStruct result))dimissBlock;
- (id)initWithTitle:(NSString *)title detail:(NSString *)detail commitButton:(NSString *)commitText cancelButton:(NSString *)cancelText dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;
- (id)initInputAlertViewWithTitle:(NSString *)title commitButton:(NSString *)commitText cancelButton:(NSString *)cancelText dismissBlock:(void (^)(EVAlertViewStruct result,NSString *inputText))dismissBlock;
/**区别于showMessageAlertView系列，以下三个函数是不带Icon的*/
+(EVAlertView*)showAlertViewWithMessage:(NSString*)message;
/**区别于showMessageAlertView系列，以下三个函数是不带Icon的*/
+(EVAlertView*)showAlertViewWithTitle:(NSString*)title Message:(NSString*)message;
/**区别于showMessageAlertView系列，以下三个函数是不带Icon的*/
+(EVAlertView*)showAlertViewWithTitle:(NSString*)title Message:(NSString*)message CommitButton:(NSString*)commitButton;
- (void)setbackgroundColor:(UIColor *)color;
- (void)show;
- (void)showInView:(UIView *)view;
- (void)dismiss;
- (void)dismissIntemidialy;

+ (EVAlertView *)showMessageAlertView:(NSString *)message;
+ (EVAlertView *)showMessageAlertView:(NSString *)message commitButton:(NSString *)commitButton;
+ (EVAlertView *)showMessageAlertView:(NSString *)message detail:(NSString *)detail commitButton:(NSString *)commitButton;
+ (EVAlertView *)showMessageAlertView:(NSString *)message detail:(NSString *)detail icon:(EVAlertIcon)icon;
+ (EVAlertView *)showMessageAlertView:(NSString *)message detail:(NSString *)detail icon:(EVAlertIcon)icon showCloseButton:(BOOL)showCloseButton;
+ (EVAlertView *)showMessageAlertView:(NSString *)message commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;
+ (EVAlertView *)showMessageAlertView:(NSString *)message detail:(NSString *)detail commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;
+ (EVAlertView *)showMessageAlertView:(NSString *)message icon:(EVAlertIcon)alertIcon commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;
+ (EVAlertView *)showMessageAlertView:(NSString *)message detail:(NSString *)detail icon:(EVAlertIcon)alertIcon commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;
+ (EVAlertView *)showMessageAlertViewInView:(UIView *)showView title:(NSString *)message detail:(NSString *)detail icon:(EVAlertIcon)alertIcon commitButton:(NSString *)commitButton cancelButton:(NSString *)cancelButton dismissBlock:(void (^)(EVAlertViewStruct result))dismissBlock;

+ (BOOL)existAlertView;

@end
